<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://ckeditor.com" prefix="ckeditor"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<html:base />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Create Post</title>
<link type="text/css" rel="stylesheet" href="../../style.css">
<link type="text/css" rel="stylesheet"
	href="../../../ckeditor/_samples/sample.css" />
</head>
<body>
	<html:form action="updatePost.do" method="post"  acceptCharset="UTF-8" enctype="multipart/form-data">
		<table>
			<tr>
				<td><label for="title" />Post name:</td>
				<td>
					<html:text property="title" styleId="title" readonly="true"/>
				</td>
				<td class="error"></td> 
			</tr>
		
			<tr>
				<td><label for="categoryTitle" />Category:</td>
				<td>
					<html:select property="categoryId" value='${postActionForm.categoryId}'>
						<logic:present name="categoryArrayList" >
							<html:optionsCollection name="categoryArrayList" value="categoryId" label="categoryTitle"/>
						</logic:present>
					</html:select>
				</td>
				<td></td>
			</tr>

			<tr>
				<td><label for="image" />Image:</td>
				<td><html:text property="image" styleId="image" /></td>
				<td style="color: red"><html:errors
						property="imageMessageError" /></td>
			</tr>
			<tr>
				<td><label for="caption" />Caption:</td>
				<td><html:text property="caption" styleId="caption" /></td>
				<td style="color: red"><html:errors
						property="captionMessageError" /></td>
			</tr>
			<tr>
				<td><label for="summary" />Summary:</td>
				<td><html:text property="summary" styleId="summary" /></td>
				<td style="color: red"><html:errors
						property="summaryMessageError" /></td>
			</tr>

			<tr>
				<td colspan="3" style="color: red">
					<html:errors property="contentMessageError" />
					<html:textarea property="content" styleId="editor"
						style="resize: none;" value='${postActionForm.content}'/></td>
			</tr>

			<tr>
				<td><label for="showed"/><bean:message key="label.showed"/></td>
				<td>
					<html:radio property="showed" styleId="showed" value="true" >Yes</html:radio>
					<html:radio property="showed" styleId="showed" value="false">No</html:radio>
				</td>
			</tr>
			
			<tr>
				<td><label for="important"/><bean:message key="label.important"/></td>
				<td>
					<html:radio property="important" styleId="important" value="true" >Yes</html:radio>
					<html:radio property="important" styleId="important" value="false">No</html:radio>
				</td>
			</tr>
		</table>

		<html:submit property="submit" value="Submit" />
		<html:hidden property="postId" styleId="postId"/>
	</html:form>

	<script type="text/javascript"
		src="../../../ckeditor/ckeditor.js?t=B37D54V"></script>
	<script type="text/javascript">
		//<![CDATA[
		CKEDITOR.replace('editor');
		//]]>
	</script>

</body>
</html>